package com.orangelife.webservice.service.paybill;

import java.util.Map;

import javax.jws.WebParam;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;

import com.orangelife.exception.AppBizException;
import com.orangelife.service.refund.modal.PropFeeRefundInfoDto;
import com.orangelife.webservice.service.paybill.entity.BillInfo;
import com.orangelife.webservice.service.paybill.entity.PayBillDto;
import com.orangelife.webservice.service.paybill.entity.PayBillInfo;
import com.orangelife.webservice.service.property.entity.PropComputeBean;

public interface IPayBillWebService {
	/**
	 * 功能:打开二位码缴费单界面
	 * */

	@GET
	@Path("/openPayBill")
	@Produces({ "application/json" })
	public Response openPayBill(@Context HttpServletRequest servletRequest,
			@QueryParam("paybillID") String paybillID,
			@QueryParam("commID") String commID) throws Exception;

	// /**
	// * 功能:更新缴费账单信息并生成二位码
	// * */
	//
	// @GET
	// @Path("/cr")
	// @Produces({ "application/json" })
	// public Response openPayBill(@Context HttpServletRequest servletRequest,
	// @QueryParam("paybillID") String paybillID,
	// @QueryParam("commID") String commID) throws Exception;

	/**
	 * 功能:打开通知单界面
	 * */

	@GET
	@Path("/openPayNoticeBill")
	@Produces({ "application/json" })
	public Response openPayNoticeBill(
			@Context HttpServletRequest servletRequest,
			@QueryParam("apartmentID") String apartmentID,
			@QueryParam("commID") String commID) throws Exception;

	/**
	 * 功能:生成缴费账单
	 * */

	@POST
	@Path("/_payBill/app")
	@Produces({ "application/json" })
	public Response _payBill(

	@Context HttpServletRequest servletRequest, @WebParam PayBillDto payBillDto)
			throws Exception;

	/**
	 * 功能:生成缴费账单并返回支付流水号
	 * */

	@POST
	@Path("/payNo/app")
	@Produces({ "application/json" })
	public Response _payBillandPayNo(

	@Context HttpServletRequest servletRequest,
			@WebParam PropComputeBean propComputeBean) throws Exception;

	/**
	 * 功能:生成支付流水号
	 * */

	@GET
	@Path("/payNo/app")
	@Produces({ "application/json" })
	public Response payNo(

	@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("payBillID") String payBillID) throws Exception;

	/**
	 * 功能:获取支付状态
	 * */

	@GET
	@Path("/payBillStatus/app")
	@Produces({ "application/json" })
	public Response getPayBillStatus(

	@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("payBillID") String payBillID) throws Exception;

	/**
	 * 功能:获取支付回调
	 * */

	@GET
	@Path("/paybillCallback")
	@Produces({ "application/json" })
	public Response paybillCallback(@Context HttpServletRequest servletRequest)
			throws Exception;

	/**
	 * 功能:扫码支付设置手机号和发票单号
	 * */

	@POST
	@Path("/_setPhoneAndInvnum")
	@Produces({ "application/json" })
	public Response _setPhoneAndInvnum(
			@Context HttpServletRequest servletRequest,
			@WebParam PropComputeBean propComputeBean) throws Exception;

	/**
	 * 功能:线下设置账单为已支付
	 * */

	@POST
	@Path("/_paybillPay")
	@Produces({ "application/json" })
	public Response _paybillPay(@Context HttpServletRequest servletRequest,
			@WebParam PayBillDto payBillDto) throws Exception;

	/**
	 * 功能:生成线下账单并设置为已支付
	 * */

	@POST
	@Path("/_offlineBill")
	@Produces({ "application/json" })
	public Response _offlineBill(@Context HttpServletRequest servletRequest,
			@WebParam PayBillDto payBillDto) throws Exception;

	/**
	 * 功能:客服设置为已支付
	 * */

	@POST
	@Path("/_paybillPayForErr")
	@Produces({ "application/json" })
	public Response _paybillPayForErr(
			@Context HttpServletRequest servletRequest,
			@WebParam PayBillInfo payBillInfo) throws Exception;

	/**
	 * 功能:线下设置账单为异常
	 * */

	@POST
	@Path("/_paybillErr")
	@Produces({ "application/json" })
	public Response _paybillErr(@Context HttpServletRequest servletRequest,
			@WebParam PropComputeBean propComputeBean) throws Exception;

	/**
	 * 功能:线下设置账单为异常
	 * */

	@POST
	@Path("/_paybillDisable")
	@Produces({ "application/json" })
	public Response _paybillDisable(@Context HttpServletRequest servletRequest,
			@WebParam PropComputeBean propComputeBean) throws Exception;

	/**
	 * 功能:获取上次缴费的的用户信息和列表
	 * */

	@GET
	@Path("/getContactList")
	@Produces({ "application/json" })
	public Response getContactList(@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentID") String apartmentID) throws Exception;

	/**
	 * 功能:发送账单地址给用短信
	 * */

	@GET
	@Path("/sendPayBillUrl")
	@Produces({ "application/json" })
	public Response sendPayBillUrl(@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentID") String apartmentID,
			@QueryParam("paybillID") String paybillID,
			@QueryParam("contactType") String contactType,
			@QueryParam("phone") String phone) throws Exception;

	/**
	 * 功能:获取支付回调
	 * */

	@GET
	@Path("/alipayapi")
	@Consumes({ "application/x-www-form-urlencoded", "application/json" })
	@Produces({ "application/json", "application/x-www-form-urlencoded" })
	public Response alipay(

	@Context HttpServletRequest servletRequest,
			@FormParam("commID") String commID,
			@FormParam("paybillID") String paybillID,
			@FormParam("type") String type) throws Exception;

	/**
	 * 功能：更新订单状态到支付中
	 * */

	@GET
	@Path("updatepaybill/app")
	@Produces({ "application/json" })
	public Response updatepaybill(@QueryParam("paybillId") String paybillId)
			throws AppBizException;

	/**
	 * 功能:获取支付回调
	 * */

	@GET
	@Path("/oweFeeDetailalipay")
	@Consumes({ "application/x-www-form-urlencoded", "application/json" })
	@Produces({ "application/json", "application/x-www-form-urlencoded" })
	public Response alipay2(

	@Context HttpServletRequest servletRequest,
			@FormParam("commID") String commID,
			@FormParam("apartmentID") String apartmentID,
			@FormParam("feeDetailIDs") String feeDetailIDs,
			@FormParam("type") String type) throws Exception;

	/**
	 * 功能：后台获取缴费账单列表
	 * */

	@GET
	@Path("/paybill/web")
	@Produces({ "application/json" })
	public Response getPayBillForWeb(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("status") String status,
			@QueryParam("apartmentID") String apartmentID,
			@QueryParam("startTime") String startTime,
			@QueryParam("endTime") String endTime,
			@QueryParam("payStartTime") String payStartTime,
			@QueryParam("payEndTime") String payEndTime,
			@QueryParam("paytime") String paytime,
			@QueryParam("payType") String payType,
			@QueryParam("payChannel") String payChannel,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws AppBizException;

	/**
	 * 功能：后天获取缴费账单列表
	 * */

	@GET
	@Path("/log")
	@Produces({ "application/json" })
	public Response getPayBillLog(@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("paybillID") String paybillID,
			@QueryParam("type") String type,
			@QueryParam("operation") String operation) throws AppBizException;

	/**
	 * 功能：后台添加退款信息
	 * */

	@POST
	@Path("/refund")
	@Produces({ "application/json" })
	public Response refund(@Context HttpServletRequest servletRequest,
			@WebParam PropFeeRefundInfoDto propFeeRefundInfoDto

	) throws AppBizException;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-08-02 16:13:34
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("interim")
	@Produces({ "application/json" })
	public Response getAllPropFeePaybill(
			@Context HttpServletRequest servletRequest,
			@WebParam Map<String, Object> payBill) throws Exception;

	/***
	 * 添加临时的缴费
	 * 
	 * @param servletRequest
	 * @param payBill
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("interimFee")
	@Produces({ "application/json" })
	public Response interimPayBill(@Context HttpServletRequest servletRequest,
			@WebParam BillInfo payBill) throws Exception;
	/**
	 * 功能：后天获取缴费账单列表
	 * */

	@GET
	@Path("/payBillItems")
	@Produces({ "application/json" })
	public Response getPayBillItems(@Context HttpServletRequest servletRequest,
			@QueryParam("paybillID") String paybillID,
			@QueryParam("itemType") String itemType,
			@QueryParam("type") String type) throws AppBizException;
	
	/***
	 * 账单生成条件是否满足并生成预缴账单
	 * 
	 * @param servletRequest
	 * @param payBill
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("_check")
	@Produces({ "application/json" })
	public Response _check(@Context HttpServletRequest servletRequest,
			@WebParam PayBillDto payBillDto) throws Exception;
	}
